/*
 * Shooter.h
 *
 *  Created on: Sep 30, 2012
 *      Author: Administrator
 */

#ifndef SHOOTER_H_
#define SHOOTER_H_

#include <FMedia.h>
#include <FBase.h>
#include "ShotMemoryStore.h"

class Shooter :
	public Osp::Media::ICameraEventListener,
	public Osp::Base::Runtime::Thread
{
public:
	Shooter();
	virtual ~Shooter();
public:
	void  OnCameraAutoFocused (bool completeCondition);
	void  OnCameraCaptured (Osp::Base::ByteBuffer &capturedData, result r);
	void  OnCameraErrorOccurred (Osp::Media::CameraErrorReason r);
	void  OnCameraPreviewed (Osp::Base::ByteBuffer &previewedData, result r);
public:
	result Construct(void);
	virtual bool OnStart(void);
	virtual void OnStop(void);
	virtual void OnUserEventReceivedN(RequestId requestId, Osp::Base::Collection::IList *pArgs);
public:
	void setState(int value);
	int getState(void);
private:
	bool stateChanged;
	int state;
	Osp::Media::Camera* camera;
	ShotMemoryStore* store;
	int delay;

};

#endif /* SHOOTER_H_ */
